<%@page import="com.appspot.zarm.controller.operations.OperationFactory"%>
<%@page import="com.appspot.zarm.controller.RequestParameters"%>
<%@page import="com.appspot.zarm.controller.Dispatcher"%>
<%@page import="com.appspot.zarm.controller.GameAction"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="js/jquery-1.8.0.js"></script>
<script type="text/javascript" src="js/index.js"></script>
<script type="text/javascript" src="js/transport.js"></script>
<script type="text/javascript" src="js/jquery.json-2.3.js"></script>
<script type="text/javascript">
	$(document).ready( function() {
		$("#singleplayer").click(function() {
			document.location="go?operation=<%=OperationFactory.GAME_OPERATION%>&action=<%=GameAction.START_ACTION%>";
		});
		
		$("#multiplayer").click(function() {
			document.location="go?operation=<%=OperationFactory.GAME_OPERATION%>&action=<%=GameAction.START_ACTION%>&<%=RequestParameters.MULTIPLAYER_PARAM%>";
		});
		
		$("#join").click(function() {
			document.location="go?operation=<%=OperationFactory.GAME_OPERATION%>&action=<%=GameAction.JOIN_ACTION%>&joinId=" + $("#sessionId").text();
		});
		
		getGamesListHTML();
	});
</script>
<title>Play gomoku</title>
</head>
<body style="background-color:#AAAAAA">

	<table border="0" width="100%" class="fade">
	<tbody>
		<tr height="270px">
			<td width="25%"></td>
			<td width="25%"></td>
			<td width="25%"></td>
			<td width="25%"></td>
		</tr>
		<tr align="center">
			<td width="25%"></td>
			<td width="25%"><button id="singleplayer">One player game</button></td>
			<td width="25%"><button id="multiplayer">Two player`s game</button></td>
		</tr>
		<tr height="50px">
			<td width="25%"></td>
		</tr>
		<tr align="center">
			<td width="25%"></td>
			<td colspan=2 width="50%">
				<select id="sessionId" disabled="disabled"></select>
				<button id="join" disabled="disabled">Join the game</button>
			</td>
		</tr>
	</tbody>
	</table>

</body>
</html>